home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc2_x / case.sit / Case Products 90 / stack.txt < prev   
Text File  |  1991-01-18  |  22KB  |  804 lines

  1. -- stack: in
  2. -- format: 8 (HyperCard 1)
  3. -- flags: 0x1000 (none)
  4. -- protect password hash: 0
  5. -- maximum user level: 5 (scripting)
  6. -- window: Rect(x1=0, y1=0, x2=0, y2=0)
  7. -- screen: Rect(x1=0, y1=0, x2=0, y2=0)
  8. -- card dimensions: w=0 h=0
  9. -- scroll: x=0 y=0
  10. -- background count: 4
  11. -- first background id: 5175
  12. -- card count: 78
  13. -- first card id: 3832
  14. -- list block id: 5643
  15. -- print block id: 24823
  16. -- font table block id: 0
  17. -- style table block id: 0
  18. -- free block count: 7
  19. -- free size: 41696 bytes
  20. -- total size: 516096 bytes
  21. -- stack block size: 20480 bytes
  22. -- created by hypercard version: 0x00000000
  23. -- compacted by hypercard version: 0x01228000
  24. -- modified by hypercard version: 0x01228000
  25. -- opened by hypercard version: 0x01228000
  26. -- patterns[0]: 0x0000000000000000
  27. -- patterns[1]: 0x8000000008000000
  28. -- patterns[2]: 0x8800220088002200
  29. -- patterns[3]: 0x55A95A94AB54AA55
  30. -- patterns[4]: 0xFFFFDFFBEFFBDFFF
  31. -- patterns[5]: 0xCCAA33AACCAA33AA
  32. -- patterns[6]: 0xEEAABBAAEEAABBAA
  33. -- patterns[7]: 0xEEBBBBEEEEBBBBEE
  34. -- patterns[8]: 0xFFBBFFEEFFBBFFEE
  35. -- patterns[9]: 0xFFBBFFFFFFBBFFFF
  36. -- patterns[10]: 0x8010022001084004
  37. -- patterns[11]: 0xFFFFFFFFFFFFFFFF
  38. -- patterns[12]: 0x8822882288228822
  39. -- patterns[13]: 0x1122448811224488
  40. -- patterns[14]: 0xFF00FF00FF00FF00
  41. -- patterns[15]: 0x8000000000000000
  42. -- patterns[16]: 0xC300B90820401600
  43. -- patterns[17]: 0x8822552288225522
  44. -- patterns[18]: 0x8855225588552255
  45. -- patterns[19]: 0x77DD77DD77DD77DD
  46. -- patterns[20]: 0x8000000000000000
  47. -- patterns[21]: 0xAA55AA55AA55AA55
  48. -- patterns[22]: 0x038448300C020101
  49. -- patterns[23]: 0x8244394482010101
  50. -- patterns[24]: 0xE0371C00F80FE000
  51. -- patterns[25]: 0x88AAAAAAAA88AA88
  52. -- patterns[26]: 0xC8C2109800666608
  53. -- patterns[27]: 0xBE808808EB088880
  54. -- patterns[28]: 0x25C8328964244C92
  55. -- patterns[29]: 0xA29C41BE2AC914EB
  56. -- patterns[30]: 0x40A00000040A0000
  57. -- patterns[31]: 0x8040200002040800
  58. -- patterns[32]: 0xAA00800088008000
  59. -- patterns[33]: 0xFF80808080808080
  60. -- patterns[34]: 0x081C22C180010204
  61. -- patterns[35]: 0xFF808080FF080808
  62. -- patterns[36]: 0xF87422478F172271
  63. -- patterns[37]: 0x4004000800200200
  64. -- patterns[38]: 0x0084200028010000
  65. -- patterns[39]: 0xFAF5FAF5A050A050
  66. -- checksum: 0x0
  67. ----- HyperTalk script -----
  68. -- Thanks to Pat Lynch's public domain Bird Anatomy for the layout
  69. -- of a few top level cards. The scripts are completely rewritten.
  70. -- We try to avoid button and field scripts. To make the functionality
  71. -- more uniform, mostly the title of buttons and fields is used to
  72. -- indicate what they are supposed to do and here we interpret
  73. -- the action according to what type and object is selected.
  74. -- This gives the whole hierarchy more of a class oriented rather
  75. -- than prototype oriented look and avoids tons of duplicated small
  76. -- scripts.
  77. -- See the HELP CARD for more info on how this works.
  78. --
  79. -- This script also contains some supporting functions that
  80. -- are only useful in develping new stacks functioning this way.
  81. -- Perhaps they are useful to others too. You have to call them
  82. -- from the message window.
  83. --
  84. --                   Enjoy,
  85. --                       Heinz
  86. --                   (hws@icsi.berkeley.edu, hws%gmdzi@relay.eu.net)
  87.  
  88. on mousewithin
  89.   get the name of the target
  90.   if it contains "card button" then sensearea
  91. end mousewithin
  92.  
  93. on mouseDown
  94.   put the name of the target into tname
  95.   if tname contains "card field" then
  96.     if the visible of the target is true and the shiftkey is down then
  97.       glossarysearch
  98.     else
  99.       put the short name of the target into tname
  100.       if tname contains "Help" or tname is in "Methods Repository Generators Price Summary Comments Ref# Languages LifeCycle" then
  101.         popupfield tname
  102.       end if
  103.     end if
  104.   else
  105.     if tname contains "card button" then
  106.       if the commandkey is down then
  107.         showbtnname
  108.       end if
  109.     else
  110.       if the optionkey is down then
  111.         allfields lock
  112.         barf "All fields of this card locked now."
  113.       end if
  114.     end if
  115.   end if
  116. end mouseDown
  117.  
  118. on mouseUp
  119.   -- figure whether this is an auto field button (no script but
  120.   -- name contains "popup"
  121.   put the name of the target into tname
  122.   if tname contains "card button" then
  123.     put the short name of the target into tname
  124.     if tname contains "popup" then
  125.       put substring(tname,7,length(tname)) into tname
  126.       popupfield tname
  127.     end if
  128.   end if
  129. end mouseUp
  130.  
  131. on showbtnname
  132.   get the name of the target
  133.   if it contains "card button" then
  134.     get the short name of the target
  135.     put it into card field "label"
  136.     show card field "Label" at the mouseH, the mouseV-20
  137.   end if
  138.   wait until the mouse is up
  139.   hide card field "label"
  140. end showbtnname
  141.  
  142. on sensearea
  143.   set cursor to BlinkHand.1
  144.   wait 5
  145.   set cursor to BlinkHand.2
  146.   wait 5
  147.   set cursor to BlinkHand.3
  148.   wait 5
  149. end sensearea
  150.  
  151. on idle
  152.   global menu1, lastTick
  153.   if (the ticks-lastTick) >120 then
  154.     put the ticks into lastTick
  155.     -- ShowMenu(menu1)
  156.   end if
  157.   pass idle
  158. end idle
  159.  
  160. -- Fields: We associate fields to visible and hidden buttons
  161. --         that pup them up. The corresponding button scripts
  162. --         run through this function. So they may behave differently
  163. --         during development and use. Moreover this way they may
  164. --         use the same feel.
  165. on popupfield afield
  166.   if the visible of card field afield is true then
  167.     set the locktext of card field afield to true
  168.     set the visible of card field afield to false
  169.     hide card field afield
  170.     if afield is "Author'sNote" then
  171.       set the scroll of card field afield of card "Main Menu" to 0
  172.     end if
  173.   else
  174.     set the visible of card field afield to true
  175.     -- Only go card has it : visual effect zoom out slowly
  176.     -- so use sound to show it didn't miss this call
  177.     -- beep
  178.     show card field afield
  179.     if the optionkey is Down then
  180.       set the locktext of card field afield to false
  181.       -- choose field tool
  182.     else -- allow second click to bring it into normal mode
  183.       set the locktext of card field afield to true
  184.     end if
  185.   end if
  186. end popupfield
  187.  
  188. -- Transitions between cards:
  189. -- Major cards for main menu, overview and the like: stuff that is
  190. -- available everywhere.
  191. -- Inside a major topic, cards behave like a separate stack of its
  192. -- own
  193.  
  194. function hasbgbtn b
  195. if the number of bg buttons > 0 then
  196.   repeat with i=1 to the number of bg buttons
  197.     put the name of bg button i into bname
  198.     if b is in bname then return i
  199.   end repeat
  200. end if
  201. return 0
  202. end hasbgbtn
  203.  
  204. function hasbtn b
  205. if the number of card buttons > 0 then
  206.   repeat with i=1 to the number of card buttons
  207.     put the name of card button i into bname
  208.     if b is in bname then return i
  209.   end repeat
  210. end if
  211. return 0
  212. end hasbtn
  213.  
  214. on clickbtn btn
  215.   put hasbtn(btn) into btnid
  216.   if btnid > 0 then
  217.     click at the loc of card button btnid
  218.   else
  219.     put hasbgbtn(btn) into btnid
  220.     if btnid > 0 then
  221.       click at the loc of bg button btnid
  222.     else answer "Cickbtn never heard of button "& btn
  223.   end if
  224. end clickbtn
  225.  
  226. ---------
  227. on opendetail c
  228.   visualiris open
  229.   go to to card c
  230. end opendetail
  231.  
  232. on closedetail
  233.   visualiris close
  234.   go back
  235. end closedetail
  236.  
  237. on opentopic c
  238.   -- mark current card
  239.   visual venetian blinds
  240.   go to card c
  241. end opentopic
  242.  
  243. on closetopic
  244.   visual barn door close
  245.   go back
  246. end closetopic
  247.  
  248. ----------------------
  249. -- Import / Export
  250. -- This is a simple facility only, we do not attempt to get a
  251. -- complete ASCII equivalent of a stack.
  252. -- Field text is filled from a file into card fields
  253. -- that are known already in the stack.
  254. -- The syntax for import/export is this:
  255. -- CARD: CardName
  256. --       makes CardName the card to copy whenever a new card is
  257. --       requested subsequently.
  258. -- :END:
  259. --        terminates the file
  260. -- FieldName: MultiLineText
  261. --        enters a multi line text into the field called FieldName.
  262. --        If the fieldname is "Name", then a new card is created
  263. --        by copying the current card called CardName.
  264. -- :: comment
  265. -- __ comment
  266. --        starts a comment line.
  267.  
  268. function nextline
  269. global textfile
  270. read from file textfile until return
  271. return it
  272. end nextline
  273.  
  274. function substring string,substart,subend
  275. -- ain't there a substring function in Hypertalk?
  276. -- Here we return start,end inclusive
  277. put "" into substr
  278. repeat with i=substart to subend
  279.   put character i of string into nextch
  280.   put substr&nextch into substr
  281. end repeat
  282. return substr
  283. end substring
  284.  
  285. function position ch,string,substart,subend
  286. -- ain't there a position function in Hypertalk?
  287. -- Here we consider start,end inclusive
  288. put false into pos
  289. repeat with i=substart to subend
  290.   if character i of string is ch then
  291.     put i into pos
  292.     exit repeat
  293.   end if
  294. end repeat
  295. return pos
  296. end position
  297.  
  298. function stringtrim string
  299. put length(string) into len
  300. put 1 into strstart
  301. put len into strend
  302. repeat with i=1 to len
  303.   put char i of string into ch
  304.   if ch = space or ch = tab or ch = return then
  305.     put i+1 into strstart
  306.   else
  307.     exit repeat
  308.   end if
  309. end repeat
  310. put len into i
  311. repeat
  312.   put char i of string into ch
  313.   if ch = space or ch = tab or ch = return then
  314.     put i-1 into strend
  315.     put i-1 into i
  316.     if i < strstart then
  317.       exit repeat
  318.     end if
  319.   else
  320.     exit repeat
  321.   end if
  322. end repeat
  323. if strstart <= strend then
  324.   return substring(string,strstart,strend)
  325. else
  326.   return ""
  327. end if
  328. end stringtrim
  329.  
  330. on handleNewEntry lin,endentry
  331.   global currentcard, currentfield
  332.   put length(lin) into len
  333.   put substring(lin,1,endentry-1) into entryname
  334.   -- skip white space
  335.   put endentry+1 into begtext
  336.   repeat with i=begtext to len
  337.     put character i of lin into ch
  338.     if not ( ch = space or ch = tab ) then
  339.       put i into begtext
  340.       exit repeat
  341.     end if
  342.   end repeat
  343.   put substring(lin,begtext,len) into entrytext
  344.   if entryname is "CARD" then
  345.     if entrytext is not empty then
  346.       put entrytext into currentcard
  347.     end if
  348.   else
  349.     put entryname into currentfield
  350.   end if
  351.   if entryname is "Name" then
  352.     newcardrequest
  353.   end if
  354.   if entryname is not "CARD" then
  355.     newfieldrequest(entrytext)
  356.   end if
  357. end handleNewEntry
  358.  
  359. on newcardrequest
  360.   global currentcard,cardind
  361.   --answer "Newcardrequest"&¤tcard
  362.   go to card currentcard
  363.   doMenu "Copy Card"
  364.   doMenu "Paste Card"
  365.   put cardind+1 into cardind
  366.   -- allow to identify these cards by program
  367.   set the name of this card to "Import"&cardind
  368.   set the cantdelete of this card to false
  369. end newcardrequest
  370.  
  371. on newfieldrequest text
  372.   global currentfield
  373.   --answer "New field:"&¤tfield
  374.   --answer "1ln:"&&text
  375.   if char 1 of text is "-" and char 2 of text is "-" then
  376.     put "" into text
  377.   end if
  378.   put text into cd field currentfield
  379. end newfieldrequest
  380.  
  381. on streamintofield lin
  382.   global currentfield
  383.   --answer "nln:"&&lin
  384.   if cd field currentfield is empty then
  385.     put lin into cd field currentfield
  386.   else
  387.     put cd field currentfield & return & lin into cd field currentfield
  388.   end if
  389. end streamintofield
  390.  
  391. on import
  392.   global textfile
  393.   opentextfile
  394.   importstack
  395.   close file textfile
  396.   answer "Update graphics Now?" with "Later" or "Now"
  397.   if it is "Now" then updimportcards
  398.   answer "Trim fields?" with "Later" or "Now"
  399.   if it is "Now" then trimimportfields
  400.   answer "Going to renumber product card names..."
  401.   renumprod
  402. end import
  403.  
  404. on importupdate afield
  405.   global textfile,currentfield,currentcard
  406.   opentextfile
  407.   repeat
  408.     put nextline() into lin
  409.     put nlines + 1 into nlines
  410.     if lin contains ":END:" then
  411.       answer nlines&&"lines read. Done..."
  412.       exit repeat
  413.     end if
  414.     put substring(lin,1,2) into startlin
  415.     -- comment lines
  416.     if startlin is not "::" and startlin is not "__" then
  417.       put length(lin) into len
  418.       put position(":",lin,2,len) into colpos
  419.       put position(" ",lin,2,len) into spacepos
  420.       if colpos is not false and (spacepos is false or colpos < spacepos ) then
  421.         handleNewEntry lin,colpos
  422.       else
  423.         if currentfield is not empty then
  424.           streamintofield lin
  425.         end if
  426.       end if
  427.     end if
  428.   end repeat
  429.   close file textfile
  430.   if afield is "Languages" then checklanguagebuttons
  431.   if afield is contained in "Methods Repository Generators" then
  432.     checksupbuttons
  433.   end if
  434.   if afield is in "Lifecycle" then checklcbuttons
  435.   put trimstring(cd field afield) into cd fld afield
  436. end importupdate
  437.  
  438. on importstack
  439.   global currentfield,currentcard,cardind
  440.   put "Productmodel" into currentcard -- default card
  441.   put "" into lin
  442.   put 0 into nlines
  443.   put 1 into cardind
  444.   put "" into currentfield
  445.   repeat
  446.     put nextline() into lin
  447.     put nlines + 1 into nlines
  448.     if lin contains ":END:" then
  449.       answer nlines&&"lines read. Done..."
  450.       exit repeat
  451.     end if
  452.     put substring(lin,1,2) into startlin
  453.     -- comment lines
  454.     if startlin is not "::" and startlin is not "__" then
  455.       put length(lin) into len
  456.       put position(":",lin,2,len) into colpos
  457.       put position(" ",lin,2,len) into spacepos
  458.       if colpos is not false and (spacepos is false or colpos < spacepos ) then
  459.         handleNewEntry lin,colpos
  460.       else
  461.         if currentfield is not empty then
  462.           streamintofield lin
  463.         end if
  464.       end if
  465.     end if
  466.   end repeat
  467. end importstack
  468.  
  469. on opentextfile
  470.   global textfile
  471.   if textfile is "" then
  472.     put "CASE.textonly" into textfile
  473.   end if
  474.   put ("TextFile = " && textfile) into temp
  475.   answer (temp) with "Import"
  476.   open file textfile
  477. end opentextfile
  478.  
  479. on trimimportfields
  480.   repeat with i=1 to the number of cards
  481.     go to cd i
  482.     show message
  483.     if the short name of this card contains "Import" then
  484.       repeat with j=1 to the number of cd fields
  485.         put the name of cd field j into message
  486.         put stringtrim(cd field j) into cd field j
  487.       end repeat
  488.     end if
  489.   end repeat
  490. end trimimportfields
  491.  
  492. on export
  493.   global textfile
  494.   opentextfile
  495.   exportstack
  496.   close file textfile
  497. end export
  498.  
  499. on extractlc
  500.   put "" into lc
  501.   put "" into pf
  502.   put pf&return&line 1 of cd fld platform into pf
  503.   put pf&return&line 2 of cd fld platform into pf
  504.   repeat with j=3 to the number of lines in cd fld platform
  505.     put lc&return&line j of cd fld platform into lc
  506.   end repeat
  507.   put stringtrim(lc) into lc
  508.   put length(lc) into len
  509.   if lc contains "Life cycle:" then
  510.     put substring(lc,12,len) into lc
  511.   end if
  512.   put stringtrim(lc) into lc
  513.   if char 1 of lc = "-" and char 2 of lc = "-" then put "" into lc
  514.   if lc is not empty then put lc into cd fld LifeCycle
  515.   put lc into message
  516.   popupfield LifeCycle
  517.   put stringtrim(pf) into pf
  518.   if cd fld Platform contains "Life cycle" then
  519.     put pf into cd fld Platform
  520.   end if
  521.   popupfield LifeCycle
  522. end extractlc
  523.  
  524. -- cannot eval prop, hence allow only a few
  525. on updgraphics
  526.   global backgroundp
  527.   put true into backgroundp
  528.   repeat with i=1 to the number of cards
  529.     go to cd i
  530.     if the short name of this card contains "Import" then
  531.       checklcbuttons
  532.       --checklanguagebuttons
  533.       --checksupportbuttons
  534.     end if
  535.   end repeat
  536.   put false into backgroundp
  537. end updgraphics
  538.  
  539. on checklanguagebuttons
  540.   -- check the languages highlighted
  541.   clkbtn("Pascal")
  542.   clkbtn("'C'")
  543.   clkbtn("C++")
  544.   clkbtn("PL/I")
  545.   clkbtn("Ada")
  546.   clkbtn("Fortran")
  547.   clkbtn("Lisp")
  548.   clkbtn("Cobol")
  549.   set the visible of cd field "Languages" to false
  550. end checklanguagebuttons
  551.  
  552. on checklcbuttons
  553.   -- check the languages highlighted
  554.   clkbtn("Analysis")
  555.   clkbtn("Design")
  556.   clkbtn("Prototyping")
  557.   clkbtn("Coding")
  558.   clkbtn("Testing")
  559.   clkbtn("Maintenance")
  560.   clkbtn("Re-engineering")
  561.   clkbtn("Planning")
  562.   clkbtn("Cross")
  563.   set the visible of cd field "LifeCycle" to false
  564. end checklcbuttons
  565.  
  566. on checksupportbuttons
  567.   -- check the languages highlighted
  568.   clkbtn("Repository")
  569.   clkbtn("Methods")
  570.   clkbtn("Generators")
  571.   set the visible of cd field "Generators" to false
  572.   set the visible of cd field "Repository" to false
  573.   set the visible of cd field "Methods" to false
  574. end checksupportbuttons
  575.  
  576. on clkbtn b
  577.   send MouseDown to cd btn b
  578.   send MouseUp to cd btn b
  579. end clkbtn
  580.  
  581. on doMenu which
  582.   if which is "Help Case" then
  583.     opentopic "Help Case"
  584.   else if which is "References" then
  585.     opentopic "References"
  586.   else if which is "Glossary" then
  587.     opentopic "Glossary"
  588.   else if which is "Tools" then
  589.     opentopic "Product 1"
  590.   else pass doMenu
  591. end doMenu
  592.  
  593. on glossarySearch
  594.   global openField,thiscard
  595.   set lockText of the target to false
  596.   put the short name of the target into openField
  597.   put the short name of this card into thiscard
  598.   -- double click
  599.   click at the clickLoc
  600.   click at the clickLoc
  601.   if the selection is empty then
  602.     set lockText of the target to true
  603.     exit glossarySearch
  604.   else
  605.     put the selection into searchWord
  606.     set lockText of the target to true
  607.     put searchWord & "ΓÇô" into searchString
  608.     set lockScreen to true
  609.     go to card "Glossary"
  610.     find searchString in field "glossary"
  611.     if the result is not empty then
  612.       go card thiscard
  613.       show card field openField
  614.       set lockscreen to false
  615.       set cursor to 4
  616.       barf "Sorry," && "ΓÇ£" & searchWord & "ΓÇ¥" && "isn't listed in the Glossary"
  617.     else
  618.       if the result is empty then
  619.         set lockScreen to false
  620.       end if
  621.     end if
  622.   end if
  623. end glossarySearch
  624.  
  625. on enterKey
  626.   choose Browse tool
  627. end enterKey
  628.  
  629. -- uniform effects solved globally
  630. -- we distinguish tree browsing and link browsing similar to
  631. -- the GNU Emacs info system. Tree has
  632. --               up, down, next, previous.
  633. -- To go down we assume there is a menu of buttons.
  634. -- up, next, previous are similarly slots, maybe buttons of a card.
  635. -- Links to related cards can be used by
  636. --                    follow.
  637. -- backward along the actual path (not the tree path)
  638. -- is supported anyway. In order not to get into the way of
  639. -- Hypercard ids next previous etc. are named more verbosely.
  640.  
  641. function goNextCard c
  642. visual scroll right
  643. go to card c
  644. result true
  645. end goNextCard
  646.  
  647. function goPrevCard c
  648. visual scroll left
  649. go to card c
  650. result true
  651. end goPrevCard
  652.  
  653. function goDownCard c
  654. visual iris open
  655. go to card c
  656. result true
  657. end goDownCard
  658.  
  659. function goUpCard c
  660. visual iris open
  661. go to card c
  662. result true
  663. end goUpCard
  664.  
  665. on openStack
  666.   global popupbuttons,savelevel,backgroundp,menu1,closingstack
  667.   put false into closingstack
  668.   put false into backgroundp
  669.   if the version < 1.2 then
  670.     answer "This stack needs HyperCard version 1.2."
  671.     set lockMessages to true
  672.     go home
  673.   else
  674.     put the userlevel into savelevel
  675.     set userLevel to 2
  676.     hide menubar
  677.     hide message
  678.     set cursor to 4
  679.     go to card "main menu"
  680.     push card
  681.     show card field "loading"
  682.     set lockScreen to true
  683.     set lockMessages to true
  684.     show all cards
  685.     set lockScreen to false
  686.     set lockMessages to false
  687.     hide card field "loading"
  688.     show card field "Author'sNote"
  689.     --put NewMenu("Select", "Tools","(-","Help Case","(-", --"References","Glossary") into menu1
  690.     --if menu1 is 0 then answer("Unable to make menu 'Sections'") --with "Damn"
  691.   end if
  692. end openStack
  693.  
  694. on closeStack
  695.   global closingstack
  696.   set cursor to 4
  697.   put true into closingstack
  698.   visual iris close
  699.   go to card "Main Menu"
  700.   visual dissolve slowly
  701.   go to card "Closing Credit"
  702.   wait 10 seconds
  703.   global menu1, saveLevel
  704.   -- put DeleteMenu(menu1) into menu1
  705.   set the userlevel to saveLevel
  706.   show menubar
  707.   -- reset the scrolls of the various scrollable cards
  708.   scrollzero
  709. end closeStack
  710.  
  711. on scrollzero
  712.   set the scroll of card field "References" of card "References" to 0
  713.   set the scroll of card field "Glossary" of card "Glossary" to 0
  714.   set the scroll of card field "Author'sNote" of card "Main Menu" to 0
  715. end scrollzero
  716.  
  717. on allFields what
  718.   if number of card fields > 0 then
  719.     repeat with i=1 to the number of card fields
  720.       if what = "show" then
  721.         set the visible of card field i to true
  722.         set the locktext of card field i to false
  723.         show card field i
  724.       else if what = "lock" then
  725.         set the locktext of card field i to true
  726.       else if what = "unlock" then
  727.         set the locktext of card field i to false
  728.       else if what = "hide" then
  729.         set the visible of card field i to false
  730.       else barf "allFields unknown option: " & what & " (ctl-.)"
  731.     end repeat
  732.   else barf "No fields on this card"
  733. end allFields
  734.  
  735. on chgaprop afield,prop,val
  736.   repeat with i=1 to the number of cards
  737.     go to card i
  738.     if the short name of this card contains "Product" then
  739.       set the visible of cd fld afield to true
  740.       -- cannot eval prop, hence allow only a few
  741.       if prop = "width" then
  742.         set the width of cd fld afield to val
  743.       else if prop = "height" then
  744.         set the height of cd fld afield to val
  745.       else if prop = "script" then
  746.         set the script of cd fld afield to val
  747.       else if prop = "style" then
  748.         set the style of cd fld afield to val
  749.       else if prop = "locktext" then
  750.         set the locktext of cd fld afield to val
  751.       else if prop = "loc" then
  752.         set the loc of cd fld afield to val
  753.       else if prop = "textfont" then
  754.         set the textfont of cd fld afield to val
  755.       else if prop = "textstyle" then
  756.         set the textstyle of cd fld afield to val
  757.       else if prop = "visible" then
  758.         set the visible of cd fld afield to val
  759.       else if prop = "textsize" then
  760.         set the textsize of cd fld afield to val
  761.       else
  762.         answer "chgaprop cannot support set"&&prop
  763.       end if
  764.       -- set the prop of cd field afield to fon
  765.     end if
  766.   end repeat
  767.   answer "Done..."
  768. end chgaprop
  769.  
  770. on chgabtn fromb,tob
  771.   repeat with i=1 to the number of cards
  772.     go to card i
  773.     if the short name of this card contains "Product" then
  774.       if hasbtn(fromb) <> 0 then
  775.         set the name of cd btn fromb to tob
  776.       end if
  777.     end if
  778.   end repeat
  779.   answer "Done..."
  780. end chgabtn
  781.  
  782. on renumprod
  783.   put 1 into ind
  784.   repeat with i=1 to the number of cards
  785.     go to card i
  786.     show message
  787.     if the short name of this card contains "Product" and the short name of this card is not "Productmodel" then
  788.       set the name of this card to "Product"&&ind
  789.       put ind + 1 into ind
  790.     end if
  791.   end repeat
  792.   answer "Done..."
  793. end renumprod
  794.  
  795. on barf mess
  796.   show message
  797.   put mess into message
  798.   play boing
  799.   wait 4 seconds
  800.   hide message
  801. end barf
  802.  
  803.  
  804.